home *** CD-ROM | disk | FTP | other *** search
-
- This document describes implementation by MpModem of special compression,
- large blocks and fast modes.
-
- The compression mode is an adaptation of Richard B. Johnson's Jmodem
- compression which is both fast and small. The overhead placed on Zmodem is
- minimal but people may experience slower than optimum speeds on rather slow
- machines. The compression method bears NO resemblance to Chuck Forsberg's
- "RLE" type compression which is copyright to that person. See MPMODEM.DOC
- for full details of how you can include this source in your code for free.
-
-
- The large block mode allows you to transfer files with large blocks of data
- than the normal maximum of 1024 bytes. This could in some cases speed up
- the transfer of files. The benefits are small but may be worthwhile in your
- application. This is copyright, but is able to be used in your programs.
- See MPMODEM.DOC for full details of how you can include this source in your
- code for free.
-
-
- The fast mode is an adaptation of Personalized Computer Programming Company
- "PC²" with one significant difference. PC²'s implementation utilises
- variable length headers which are purportedly the copyright material of
- Chuck Forsberg. Given this, I have adapted this process to not use variable
- length headers. See MPMODEM.DOC for full details of how you can include
- this source in your code for free.
-
-
- There are various files included in this archive. All these files are
- designed only to show programmers the way to change their implementation of
- Zmodem to use the above enhancements.
-
-
- The files are:
-
- Z-RX.C - Contains all the receive specific routines required by
- Zmodem. Only the routines applicable to the above
- modifications are contained.
-
- Z-TX.C - Contains all the send specific routines required by
- Zmodem. Only the routines applicable to the above
- modifications are contained.
-
- Z-GEN.C - Contains all of the miscellaneous routines used by
- Zmodem. Only routines applicable to the above
- modifications are contained.
-
- Z-GEN.H - Contains Zmodem defines and masks used to determine such
- things as whether the remote can send/receive in fast
- and/or compressed mode and so on.
-
- COMPRESS.C - Contains the compression and decompression routines.
-
- COMPRESS.H - Header file for inclusion in Z-RX.C and Z-TX.C (if
- required).
-
- Rather than explain all the nuts and bolts of the two methods, I will leave
- that to the code. I will explain the main variables though:
-
- Variable
- Name Description
- ------------------------------------------------------------------------
- RxType
- Current type of transmission being received. These values
- are established when the receiver receives a header. The
- possible values are:
- 0 - Binary (with CRC-16) and Hex headers.
- 1 - Binary (with CRC-32).
- 2 - Not used (next release).
- 3 - Binary compressed (with CRC-32).
- 4 - Binary compressed (with CRC-16).
-
- TxType Current type of transmission being sent. These values are
- established by what you want (compression, FAST etc) and
- what the receiver says it wants. It is reinstated from
- TxMaster when you send a binary header. This allows the
- binary transmission to be sent in the mode negotiated at
- startup.
-
- TxMaster This is the transfer type master flag which is negotiated
- at startup with the receiver. This value is used to
- reinstate the transfer type after it has changed (when a
- hex header has been sent). Possible values are the same
- as RxType. (see above)
-
- TryComp This is a flag which is set depending on the command line
- options. In MpModem's case, it is set when MpModem is
- invoked with "-c".
-
- TryFast This is a flag which is set depending on the command line
- options. In MpModem's case, it is set when MpModem is
- invoked with "-f".
-
- TryBig This is a flag which is set depending on the command line
- options. In MpModem's case, it is set when MpModem is
- invoked with the "-l" switch.
-
- WantComp In send mode:
- Receiver has said it wants to try compression. If
- "TryComp" is also true, then the sender will send off
- a header telling the receiver that it also wants to
- try compression. In this case, compression has been
- negotiated successfully and will take place when
- needed.
-
- In receive mode:
- If "TryComp" has been set by the command line switch
- of "-c" then the receiver will check the packet sent
- by the sender. If it contains a directive to use
- compression, then the receiver will set this flag
- enabling compression.
-
- Note: The "WantComp" flag is not really needed once
- the compression has been negotiated successfully. The
- way the receiver knows if the sender is sending a
- compressed packet is by the frame end (eg ZCRCG_C as
- against ZCRCG).
-
- WantFast In send mode:
- Receiver has sent a header. If in that header is the
- command to try a Fast transmission then the sender
- sets "WantFast" to 1. If the flag "TryFast" has been
- set, then the sender will send off confirmation of
- wanting a fast transmission.
-
- In receive mode:
- Not required or used in receive mode.
-
- WantBig In send mode:
- Receiver has signalled its intention to try to send
- large blocks. Once set to TRUE, and providing the
- sender wants to also send big blocks, the sender will
- send off confirmation that we want a transmission made
- up of big blocks.
-
- In receive mode:
- This is used by MpModem to regulate repositions. I use
- this flag when a reposition is received to IMMEDIATELY
- cut the block size down - the bigger block size is a
- real killer when you have to go back and resend part
- of the file.
-
- UsingBig In send mode:
- Not used as yet.
-
- In receive mode:
- Not used as yet.
-
- UsingFast In send mode:
- This flag is set to 1 (true) if the command line
- switch "TryFast" is set to 1 (see above) and the
- "WantFast" switch is also set to 1 (see above). Once
- set to 1, "UsingFast" will make the SendByte() routine
- in the Z-TX.C file ONLY escape ZDLE bytes. All other
- bytes will go through without any special encoding.
-
- In receive mode:
- Set to 1 (true) if the sender wants a fast
- transmission. This flag is then used in the routine
- which gets the bytes to bypass some of the checks for
- encoded bytes. See Z-GEN.C routine GetZDLE().
-
- Logically (and if you are into saving a few bytes) you
- could replace the "if (UsingFast)..." type statements
- with "if (WantFast && TryFast)...". I found it easier
- just to type in one word rather than a series of words.
- What can I say, I'm lazy!!
-
- +--------------------------------------------------------+
- | S P E C I A L N O T E |
- | ~~~~~~~~~~~~~~~~~~~~~~~~ |
- | |
- | When you implement FAST mode, be aware that this can |
- | only occur in EXCLUSION of control escaping of various |
- | characters. Thus any attempt to escape special |
- | characters while FAST mode is wanted will lead to an |
- | impasse. You are therefore warned to stop this |
- | occurring. |
- +--------------------------------------------------------+
-
-
-
- ------------------------------------------------------------------------
-
- Please note that this code comes with no guarantees as to its ability to
- work or even perform as it should. It is close enough to the code I use for
- MPModem to be sufficiently robust for un-tested implementation. However, as
- always the onus is upon you to ensure the code does what it purports to do.
-
- All code herein is included to help developers and is provided free of
- charge and encumbrance other than that mentioned in MPMODEM.DOC - please
- see that for full details.
-
- If you need help with your code or understanding mine, then please feel
- free to email me questions at speednut@werple.apana.org.au
-
- *** DO NOT EMAIL ME YOUR CODE!!! ***
-
- Any spelling mistakes are mine, and I am proud of them!!!
-
- -----------------------------------
-
- This document is Copyright (C) 1993 - Mark Jose.
-
- -----------------------------------